package com.houpu.service;


import com.houpu.dao.DepartmentMapper;
import com.houpu.pojo.Department;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class DepartmentService {
    @Autowired(required = false)
    private DepartmentMapper departmentMapper;

    public List<Department> queryAll(Department department) {
        return departmentMapper.queryAll(department);
    }
    public List<Department> queryP_isor0(Department department) {
        return departmentMapper.queryP_isor0(department);
    }
    public int update(Department department){

        return departmentMapper.update(department);
    }

    public int delete(Department department){
        return departmentMapper.updateP_is(department);
    }

    public int insert(Department department){
//        Map<String,Object> map = new HashMap<>();
//        map.put("p_name","销售部");
//        map.put("p_remark","部门5");
//        map.put("p_is",0);
        return departmentMapper.insert(department);
    }

    public int updateP_isor1(Department department){
        return departmentMapper.updateP_isor1(department);
    }
}
